package action;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import vo.DogBean;
import biz.CartBiz;
import biz.DogBiz;

public class DogCartAddAction implements DogAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		DogBiz dogBiz = new DogBiz();
		DogBean bean = dogBiz.getDog(id);
		
		CartBiz cartBiz = new CartBiz();
		cartBiz.addCart(request, bean);
		
		RequestDispatcher dis = 
				request.getRequestDispatcher("dogcartlist.dog");
		try {
			dis.forward(request, response);
		} catch (ServletException | IOException e) {
			e.printStackTrace();
		}//try~catch
	}//exe
}//class
